Integrand size = 14, antiderivative size = 127 \[ \int (c+d x)^3 \cot (a+b x) \, dx=-\frac {i (c+d x)^4}{4 d}+\frac {(c+d x)^3 \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {3 i d (c+d x)^2 \operatorname {PolyLog}\left (2,e^{2 i (a+b x)}\right )}{2 b^2}+\frac {3 d^2 (c+d x) \operatorname {PolyLog}\left (3,e^{2 i (a+b x)}\right )}{2 b^3}+\frac {3 i d^3 \operatorname {PolyLog}\left (4,e^{2 i (a+b x)}\right )}{4 b^4} \]
[Out]
Time = 0.21 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {3798, 2221, 2611, 6744, 2320, 6724} \[ \int (c+d x)^3 \cot (a+b x) \, dx=\frac {3 i d^3 \operatorname {PolyLog}\left (4,e^{2 i (a+b x)}\right )}{4 b^4}+\frac {3 d^2 (c+d x) \operatorname {PolyLog}\left (3,e^{2 i (a+b x)}\right )}{2 b^3}-\frac {3 i d (c+d x)^2 \operatorname {PolyLog}\left (2,e^{2 i (a+b x)}\right )}{2 b^2}+\frac {(c+d x)^3 \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {i (c+d x)^4}{4 d} \]
[In]
[Out]
Rule 2221
Rule 2320
Rule 2611
Rule 3798
Rule 6724
Rule 6744
Rubi steps \begin{align*} \text {integral}& = -\frac {i (c+d x)^4}{4 d}-2 i \int \frac {e^{2 i (a+b x)} (c+d x)^3}{1-e^{2 i (a+b x)}} \, dx \\ & = -\frac {i (c+d x)^4}{4 d}+\frac {(c+d x)^3 \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {(3 d) \int (c+d x)^2 \log \left (1-e^{2 i (a+b x)}\right ) \, dx}{b} \\ & = -\frac {i (c+d x)^4}{4 d}+\frac {(c+d x)^3 \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {3 i d (c+d x)^2 \operatorname {PolyLog}\left (2,e^{2 i (a+b x)}\right )}{2 b^2}+\frac {\left (3 i d^2\right ) \int (c+d x) \operatorname {PolyLog}\left (2,e^{2 i (a+b x)}\right ) \, dx}{b^2} \\ & = -\frac {i (c+d x)^4}{4 d}+\frac {(c+d x)^3 \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {3 i d (c+d x)^2 \operatorname {PolyLog}\left (2,e^{2 i (a+b x)}\right )}{2 b^2}+\frac {3 d^2 (c+d x) \operatorname {PolyLog}\left (3,e^{2 i (a+b x)}\right )}{2 b^3}-\frac {\left (3 d^3\right ) \int \operatorname {PolyLog}\left (3,e^{2 i (a+b x)}\right ) \, dx}{2 b^3} \\ & = -\frac {i (c+d x)^4}{4 d}+\frac {(c+d x)^3 \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {3 i d (c+d x)^2 \operatorname {PolyLog}\left (2,e^{2 i (a+b x)}\right )}{2 b^2}+\frac {3 d^2 (c+d x) \operatorname {PolyLog}\left (3,e^{2 i (a+b x)}\right )}{2 b^3}+\frac {\left (3 i d^3\right ) \text {Subst}\left (\int \frac {\operatorname {PolyLog}(3,x)}{x} \, dx,x,e^{2 i (a+b x)}\right )}{4 b^4} \\ & = -\frac {i (c+d x)^4}{4 d}+\frac {(c+d x)^3 \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {3 i d (c+d x)^2 \operatorname {PolyLog}\left (2,e^{2 i (a+b x)}\right )}{2 b^2}+\frac {3 d^2 (c+d x) \operatorname {PolyLog}\left (3,e^{2 i (a+b x)}\right )}{2 b^3}+\frac {3 i d^3 \operatorname {PolyLog}\left (4,e^{2 i (a+b x)}\right )}{4 b^4} \\ \end{align*}
Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(560\) vs. \(2(127)=254\).
Time = 2.86 (sec) , antiderivative size = 560, normalized size of antiderivative = 4.41 \[ \int (c+d x)^3 \cot (a+b x) \, dx=\frac {6 i b^3 c^2 d \pi x+4 i b^4 c d^2 x^3+i b^4 d^3 x^4-12 i b^3 c^2 d x \arctan (\tan (a))+6 b^4 c^2 d x^2 \cot (a)+6 b^2 c^2 d \pi \log \left (1+e^{-2 i b x}\right )+12 b^3 c d^2 x^2 \log \left (1-e^{-i (a+b x)}\right )+4 b^3 d^3 x^3 \log \left (1-e^{-i (a+b x)}\right )+12 b^3 c d^2 x^2 \log \left (1+e^{-i (a+b x)}\right )+4 b^3 d^3 x^3 \log \left (1+e^{-i (a+b x)}\right )+12 b^3 c^2 d x \log \left (1-e^{2 i (b x+\arctan (\tan (a)))}\right )+12 b^2 c^2 d \arctan (\tan (a)) \log \left (1-e^{2 i (b x+\arctan (\tan (a)))}\right )-6 b^2 c^2 d \pi \log (\cos (b x))+4 b^3 c^3 \log (\sin (a+b x))-12 b^2 c^2 d \arctan (\tan (a)) \log (\sin (b x+\arctan (\tan (a))))+12 i b^2 d^2 x (2 c+d x) \operatorname {PolyLog}\left (2,-e^{-i (a+b x)}\right )+12 i b^2 d^2 x (2 c+d x) \operatorname {PolyLog}\left (2,e^{-i (a+b x)}\right )-6 i b^2 c^2 d \operatorname {PolyLog}\left (2,e^{2 i (b x+\arctan (\tan (a)))}\right )+24 b c d^2 \operatorname {PolyLog}\left (3,-e^{-i (a+b x)}\right )+24 b d^3 x \operatorname {PolyLog}\left (3,-e^{-i (a+b x)}\right )+24 b c d^2 \operatorname {PolyLog}\left (3,e^{-i (a+b x)}\right )+24 b d^3 x \operatorname {PolyLog}\left (3,e^{-i (a+b x)}\right )-24 i d^3 \operatorname {PolyLog}\left (4,-e^{-i (a+b x)}\right )-24 i d^3 \operatorname {PolyLog}\left (4,e^{-i (a+b x)}\right )-6 b^4 c^2 d e^{i \arctan (\tan (a))} x^2 \cot (a) \sqrt {\sec ^2(a)}}{4 b^4} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 791 vs. \(2 (108 ) = 216\).
Time = 1.16 (sec) , antiderivative size = 792, normalized size of antiderivative = 6.24
method | result | size |
risch | \(-\frac {3 i d^{3} \operatorname {polylog}\left (2, {\mathrm e}^{i \left (x b +a \right )}\right ) x^{2}}{b^{2}}-\frac {2 i d^{3} a^{3} x}{b^{3}}+\frac {3 c \,d^{2} a^{2} \ln \left ({\mathrm e}^{i \left (x b +a \right )}-1\right )}{b^{3}}+\frac {6 c^{2} d a \ln \left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b^{2}}-\frac {3 c^{2} d a \ln \left ({\mathrm e}^{i \left (x b +a \right )}-1\right )}{b^{2}}-\frac {d^{3} a^{3} \ln \left ({\mathrm e}^{i \left (x b +a \right )}-1\right )}{b^{4}}+\frac {6 i d^{3} \operatorname {polylog}\left (4, {\mathrm e}^{i \left (x b +a \right )}\right )}{b^{4}}-\frac {3 c \,d^{2} \ln \left (1-{\mathrm e}^{i \left (x b +a \right )}\right ) a^{2}}{b^{3}}+\frac {3 d \,c^{2} \ln \left (1-{\mathrm e}^{i \left (x b +a \right )}\right ) a}{b^{2}}-\frac {6 c \,d^{2} a^{2} \ln \left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b^{3}}+\frac {3 d \,c^{2} \ln \left (1-{\mathrm e}^{i \left (x b +a \right )}\right ) x}{b}-\frac {3 i d \,c^{2} a^{2}}{b^{2}}-\frac {3 i d \,c^{2} \operatorname {polylog}\left (2, {\mathrm e}^{i \left (x b +a \right )}\right )}{b^{2}}-\frac {3 i d \,c^{2} \operatorname {polylog}\left (2, -{\mathrm e}^{i \left (x b +a \right )}\right )}{b^{2}}+\frac {4 i c \,d^{2} a^{3}}{b^{3}}+\frac {2 d^{3} a^{3} \ln \left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b^{4}}+\frac {6 d^{3} \operatorname {polylog}\left (3, -{\mathrm e}^{i \left (x b +a \right )}\right ) x}{b^{3}}+\frac {d^{3} \ln \left (1-{\mathrm e}^{i \left (x b +a \right )}\right ) a^{3}}{b^{4}}+\frac {6 d^{3} \operatorname {polylog}\left (3, {\mathrm e}^{i \left (x b +a \right )}\right ) x}{b^{3}}-\frac {3 i d^{3} a^{4}}{2 b^{4}}+\frac {6 i d^{3} \operatorname {polylog}\left (4, -{\mathrm e}^{i \left (x b +a \right )}\right )}{b^{4}}+\frac {d^{3} \ln \left (1-{\mathrm e}^{i \left (x b +a \right )}\right ) x^{3}}{b}+\frac {d^{3} \ln \left ({\mathrm e}^{i \left (x b +a \right )}+1\right ) x^{3}}{b}+\frac {6 c \,d^{2} \operatorname {polylog}\left (3, {\mathrm e}^{i \left (x b +a \right )}\right )}{b^{3}}+\frac {6 c \,d^{2} \operatorname {polylog}\left (3, -{\mathrm e}^{i \left (x b +a \right )}\right )}{b^{3}}+\frac {c^{3} \ln \left ({\mathrm e}^{i \left (x b +a \right )}-1\right )}{b}-\frac {i d^{3} x^{4}}{4}+i c^{3} x +\frac {i c^{4}}{4 d}+\frac {3 d \,c^{2} \ln \left ({\mathrm e}^{i \left (x b +a \right )}+1\right ) x}{b}+\frac {3 c \,d^{2} \ln \left (1-{\mathrm e}^{i \left (x b +a \right )}\right ) x^{2}}{b}-\frac {3 i d^{3} \operatorname {polylog}\left (2, -{\mathrm e}^{i \left (x b +a \right )}\right ) x^{2}}{b^{2}}+\frac {c^{3} \ln \left ({\mathrm e}^{i \left (x b +a \right )}+1\right )}{b}-\frac {2 c^{3} \ln \left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b}+\frac {3 c \,d^{2} \ln \left ({\mathrm e}^{i \left (x b +a \right )}+1\right ) x^{2}}{b}-i d^{2} c \,x^{3}-\frac {3 i d \,c^{2} x^{2}}{2}-\frac {6 i c \,d^{2} \operatorname {polylog}\left (2, -{\mathrm e}^{i \left (x b +a \right )}\right ) x}{b^{2}}-\frac {6 i d \,c^{2} x a}{b}+\frac {6 i c \,d^{2} a^{2} x}{b^{2}}-\frac {6 i c \,d^{2} \operatorname {polylog}\left (2, {\mathrm e}^{i \left (x b +a \right )}\right ) x}{b^{2}}\) | \(792\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 818 vs. \(2 (104) = 208\).
Time = 0.31 (sec) , antiderivative size = 818, normalized size of antiderivative = 6.44 \[ \int (c+d x)^3 \cot (a+b x) \, dx=\frac {6 i \, d^{3} {\rm polylog}\left (4, \cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) - 6 i \, d^{3} {\rm polylog}\left (4, \cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) - 6 i \, d^{3} {\rm polylog}\left (4, -\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) + 6 i \, d^{3} {\rm polylog}\left (4, -\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) - 3 \, {\left (i \, b^{2} d^{3} x^{2} + 2 i \, b^{2} c d^{2} x + i \, b^{2} c^{2} d\right )} {\rm Li}_2\left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) - 3 \, {\left (-i \, b^{2} d^{3} x^{2} - 2 i \, b^{2} c d^{2} x - i \, b^{2} c^{2} d\right )} {\rm Li}_2\left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) - 3 \, {\left (-i \, b^{2} d^{3} x^{2} - 2 i \, b^{2} c d^{2} x - i \, b^{2} c^{2} d\right )} {\rm Li}_2\left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) - 3 \, {\left (i \, b^{2} d^{3} x^{2} + 2 i \, b^{2} c d^{2} x + i \, b^{2} c^{2} d\right )} {\rm Li}_2\left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) + {\left (b^{3} d^{3} x^{3} + 3 \, b^{3} c d^{2} x^{2} + 3 \, b^{3} c^{2} d x + b^{3} c^{3}\right )} \log \left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + 1\right ) + {\left (b^{3} d^{3} x^{3} + 3 \, b^{3} c d^{2} x^{2} + 3 \, b^{3} c^{2} d x + b^{3} c^{3}\right )} \log \left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + 1\right ) + {\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )} \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) + \frac {1}{2} i \, \sin \left (b x + a\right ) + \frac {1}{2}\right ) + {\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )} \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) - \frac {1}{2} i \, \sin \left (b x + a\right ) + \frac {1}{2}\right ) + {\left (b^{3} d^{3} x^{3} + 3 \, b^{3} c d^{2} x^{2} + 3 \, b^{3} c^{2} d x + 3 \, a b^{2} c^{2} d - 3 \, a^{2} b c d^{2} + a^{3} d^{3}\right )} \log \left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + 1\right ) + {\left (b^{3} d^{3} x^{3} + 3 \, b^{3} c d^{2} x^{2} + 3 \, b^{3} c^{2} d x + 3 \, a b^{2} c^{2} d - 3 \, a^{2} b c d^{2} + a^{3} d^{3}\right )} \log \left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + 1\right ) + 6 \, {\left (b d^{3} x + b c d^{2}\right )} {\rm polylog}\left (3, \cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) + 6 \, {\left (b d^{3} x + b c d^{2}\right )} {\rm polylog}\left (3, \cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) + 6 \, {\left (b d^{3} x + b c d^{2}\right )} {\rm polylog}\left (3, -\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) + 6 \, {\left (b d^{3} x + b c d^{2}\right )} {\rm polylog}\left (3, -\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right )}{2 \, b^{4}} \]
[In]
[Out]
\[ \int (c+d x)^3 \cot (a+b x) \, dx=\int \left (c + d x\right )^{3} \cos {\left (a + b x \right )} \csc {\left (a + b x \right )}\, dx \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 759 vs. \(2 (104) = 208\).
Time = 0.34 (sec) , antiderivative size = 759, normalized size of antiderivative = 5.98 \[ \int (c+d x)^3 \cot (a+b x) \, dx=\frac {4 \, c^{3} \log \left (\sin \left (b x + a\right )\right ) - \frac {12 \, a c^{2} d \log \left (\sin \left (b x + a\right )\right )}{b} + \frac {12 \, a^{2} c d^{2} \log \left (\sin \left (b x + a\right )\right )}{b^{2}} - \frac {4 \, a^{3} d^{3} \log \left (\sin \left (b x + a\right )\right )}{b^{3}} + \frac {-i \, {\left (b x + a\right )}^{4} d^{3} - 4 \, {\left (i \, b c d^{2} - i \, a d^{3}\right )} {\left (b x + a\right )}^{3} + 24 i \, d^{3} {\rm Li}_{4}(-e^{\left (i \, b x + i \, a\right )}) + 24 i \, d^{3} {\rm Li}_{4}(e^{\left (i \, b x + i \, a\right )}) - 6 \, {\left (i \, b^{2} c^{2} d - 2 i \, a b c d^{2} + i \, a^{2} d^{3}\right )} {\left (b x + a\right )}^{2} - 4 \, {\left (-i \, {\left (b x + a\right )}^{3} d^{3} + 3 \, {\left (-i \, b c d^{2} + i \, a d^{3}\right )} {\left (b x + a\right )}^{2} + 3 \, {\left (-i \, b^{2} c^{2} d + 2 i \, a b c d^{2} - i \, a^{2} d^{3}\right )} {\left (b x + a\right )}\right )} \arctan \left (\sin \left (b x + a\right ), \cos \left (b x + a\right ) + 1\right ) - 4 \, {\left (i \, {\left (b x + a\right )}^{3} d^{3} + 3 \, {\left (i \, b c d^{2} - i \, a d^{3}\right )} {\left (b x + a\right )}^{2} + 3 \, {\left (i \, b^{2} c^{2} d - 2 i \, a b c d^{2} + i \, a^{2} d^{3}\right )} {\left (b x + a\right )}\right )} \arctan \left (\sin \left (b x + a\right ), -\cos \left (b x + a\right ) + 1\right ) - 12 \, {\left (i \, b^{2} c^{2} d - 2 i \, a b c d^{2} + i \, {\left (b x + a\right )}^{2} d^{3} + i \, a^{2} d^{3} + 2 \, {\left (i \, b c d^{2} - i \, a d^{3}\right )} {\left (b x + a\right )}\right )} {\rm Li}_2\left (-e^{\left (i \, b x + i \, a\right )}\right ) - 12 \, {\left (i \, b^{2} c^{2} d - 2 i \, a b c d^{2} + i \, {\left (b x + a\right )}^{2} d^{3} + i \, a^{2} d^{3} + 2 \, {\left (i \, b c d^{2} - i \, a d^{3}\right )} {\left (b x + a\right )}\right )} {\rm Li}_2\left (e^{\left (i \, b x + i \, a\right )}\right ) + 2 \, {\left ({\left (b x + a\right )}^{3} d^{3} + 3 \, {\left (b c d^{2} - a d^{3}\right )} {\left (b x + a\right )}^{2} + 3 \, {\left (b^{2} c^{2} d - 2 \, a b c d^{2} + a^{2} d^{3}\right )} {\left (b x + a\right )}\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} + 2 \, \cos \left (b x + a\right ) + 1\right ) + 2 \, {\left ({\left (b x + a\right )}^{3} d^{3} + 3 \, {\left (b c d^{2} - a d^{3}\right )} {\left (b x + a\right )}^{2} + 3 \, {\left (b^{2} c^{2} d - 2 \, a b c d^{2} + a^{2} d^{3}\right )} {\left (b x + a\right )}\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} - 2 \, \cos \left (b x + a\right ) + 1\right ) + 24 \, {\left (b c d^{2} + {\left (b x + a\right )} d^{3} - a d^{3}\right )} {\rm Li}_{3}(-e^{\left (i \, b x + i \, a\right )}) + 24 \, {\left (b c d^{2} + {\left (b x + a\right )} d^{3} - a d^{3}\right )} {\rm Li}_{3}(e^{\left (i \, b x + i \, a\right )})}{b^{3}}}{4 \, b} \]
[In]
[Out]
\[ \int (c+d x)^3 \cot (a+b x) \, dx=\int { {\left (d x + c\right )}^{3} \cos \left (b x + a\right ) \csc \left (b x + a\right ) \,d x } \]
[In]
[Out]
Timed out. \[ \int (c+d x)^3 \cot (a+b x) \, dx=\int \frac {\cos \left (a+b\,x\right )\,{\left (c+d\,x\right )}^3}{\sin \left (a+b\,x\right )} \,d x \]
[In]
[Out]